package synchro;

import java.io.File;
import java.io.IOException;

/**
 * @author DELL
 * @create 2017-09-22 17:48
 */
public class TestLogfile2 {
    public static void main(String[] args) throws IOException, InterruptedException {
        LogFile2 logFile = new LogFile2(new File("src/file/log1.txt"));
        LogFileThread2 log1 = new LogFileThread2(logFile, "good morning");
        LogFileThread2 log2 = new LogFileThread2(logFile, "good afternoon");
        LogFileThread2 log3 = new LogFileThread2(logFile, "good evening");
        Thread t1 = new Thread(log1);
        t1.sleep(10);
        Thread t2 = new Thread(log2);
        t2.sleep(20);
        Thread t3 = new Thread(log3);
        t3.sleep(10);
        t1.start();
        t2.start();
        t3.start();
    }
}
